<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
  button.active{
    background-color: red;
  }
  .box{
    width: 200px;
    height: 200px;
    font-size: 60px;
    border: 1px solid;
    text-align: center;
    line-height: 200px;
  }
</style>
<body>
<div id="app">
  <button :class="{active: num===0}" @click="add(0)">标题1</button>
  <button :class="{active: num===1}" @click="add(1)">标题2</button>
  <button :class="{active: num===2}" @click="add(2)">标题3</button>
  <div class="box" v-show="num===0">内容1</div>
  <div class="box" v-show="num===1">内容2</div>
  <div class="box" v-show="num===2">内容3</div>
</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
<script>
const vm = new Vue ( {
  el: '#app',
  data: {
    num: 0
  },
  methods: {
    add(n){
      this.num=n
    }
  }
} )
</script>
</html>